package android.com.app;

import java.io.FileInputStream;

import android.app.Activity;
import android.app.ListActivity;
import android.com.app.DBAdapter.Table;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;

public class getString extends Activity{
	
	private EditText mTitleText;
    private TextView mBodyText;

    protected void onCreate(Bundle savedInstanceState) {
		    
		 	super.onCreate(savedInstanceState);
	        setContentView(R.layout.tagnameview);
	        mTitleText = (EditText) findViewById(R.id.title);
	        mBodyText= (TextView) findViewById(R.id.tv1);
        
	        Button confirmButton = (Button) findViewById(R.id.confirm);
	        Button confirmButton1 = (Button) findViewById(R.id.confirm1);
	        confirmButton.setOnClickListener(new View.OnClickListener() {
	        public void onClick(View view) {
	               	Bundle bundle = new Bundle();
	               	if(mTitleText.getText().toString().equals("")) {
	               		mBodyText.setText("Please Enter a valid tag name");
	               		return;
	               	}
	             	bundle.putString("TagName", mTitleText.getText().toString());
	                Intent mIntent = new Intent();
	                mIntent.putExtras(bundle); 
	                setResult(RESULT_OK, mIntent); 
	            	finish();
	            }
	        });
	        
	        confirmButton1.setOnClickListener(new View.OnClickListener() {
	        	public void onClick(View view) {
	            setResult(RESULT_OK); 
	           	finish();
	        }
	    });
	    }


}
	   
